package com.kx.yooli.kx.wechat.utils.comm;

import org.apache.commons.compress.utils.Lists;
import org.apache.poi.ss.formula.functions.T;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.List;

/**
 * @author john_sqwen
 * @date 2024/3/20
 * @PROJECT_NAME wechat
 * @description create ListUtils by john_sqwen
 * and listutils value is
 */
public class ListUtils {
    private static final Logger log = LoggerFactory.getLogger(ListUtils.class);
    /**
     *
     * @param list List<> type String
     * @param moveStrNull has remove List<String> add("list") param true move else save
     * @return list<String>
     */
    public List<String> removeListNull(List<String> list ,boolean moveStrNull){
        if(list.isEmpty()){
            throw  new RuntimeException("param value is empty"+list);
        }
        if(moveStrNull) {
            Collections.replaceAll(list, "null", null);
        }
        list.removeAll(Collections.singleton(null));
        return list;
    }
}
